fixed bugs related to issue #1
bug fixes and better action semantics
Merged in with trunk