Fixed a few bugs for proper installation by pip