Bug fixes - working well but only somewhat tested