fixed all remaining bugs from source control rollback