Fixed a bunch of feature requests and bugs