debug.warn

Added a debug.warn to avoid having to have alerts popping. Don't know if you want that but here it is. I also fixed a small bug see commit.