Fixes

Bug Fixes, ready for testing.