Various fixes and removal of unused features