Many, many bugfixes for edge cases
SMS tests added