Dmitry's fixes and implementation of getPrincipalIdeal()
Methods not in interface made package protected