removed more unused code, correctly implemented allownull on getbaseclass.