Bugfixes and some useful features