Fixed a number of small bugs

Many naming-bugs had formerly been hidden and now shows up
due to the fact that qms is now imported and not run directly
from its own py-file