Add search support
Fix some parsing bugs