Bugfix

Lots of changes, detailed in each pull request
NPE potention on action.trim()?