Fix core.
Fix core.
Fix core.
Fix core script.
Merge pull request #502 from gsn/master

Merged from beta.