Added some safeguards and warnings