Bug fixes
Final changes (hopefully)