TYPO: tabs to spaces, indentication, etc...
remove and change unused variables
FIX: quantum in simple
FIX: duplicate variables
fix quantum database vars undefined
Merge pull request #655 from xenolog/PRD-2017

FIX: quantum in simple