Bugfix and removed some development testing code.