fixed a few bugs & incompatibilities