Fixed some warnings
Fixed a bug with the instantiation