cleanup
Merge application.cpp
Small fixes for VS2012