SS3.1 Compatibility

Have updated to 3.1 compatible code. You may want to branch or tag your current 3.0 code before accepting pull request.