Bug fixes, removal of unnecessary files