Fixed a few minor bugs. Console test application is working again.