Better action parsing, Fixes #4.