Various fixes and additions