removed run-time notices and some warnings