removed compilation warnings and execution errors