various bug fixing and hotfixes