On both of these error messages, I think that it helps if you echo the value that was passed (using "%r"" rather than "%s").