Parse keywords more robustly