Fix leading/trailing whitespace syntax detection

To fix #42.