Some bug fixes etc..