Bug Fixes

Some bug fixes, but there is still one really weird one...