Fixes

Fixed first part of #174, not sure about the second part
Fixed #198
Fixed #200