Various improvements / bugfixes