Bug fixes

Final additions