Fixes namespace bug and other minor bug