Fixed lots of bugs bace classes should be mostly done
npe bug fixes