Various fixes and custom additions