Fixed some syntax-based features, cleaned up debug output.