Bug fixes and further refactoring
Bug fixes and further refactoring

johnbachman/indra,johnbachman/belpy,johnbachman/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/indra,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,pvtodorov/indra