Add sip support
Some more sip changes and bug fixes from the last commit.