Program compiles, but unexpected outcome.