Fix warning message and other fixes