More bug fixes hopefully