Specs fix

Branch was used to start fixing type specifications. Better to do this directly on master, therefore merging the changes back now.