Fixes minor bugs and added warning