Various fixes to make it work with smartos