Added logging and warnings