If you start your program with sub main (main not Main) then you will face strange behaviour. It's a known bug!