Bug fixes, added some new files