REL-2074: Fixed possible NPE in QPT and cleaned up code.
REL-2074: Changes as recommended by Rob.
Merge pull request #66 from sraaphorst/feature/REL-2074

REL-2074: Fixed possible NPE in QPT and cleaned up code.