Small issues

Many small bug fixes and feature requests