Fixed WhatId assignment in task creation
Added check for profile access to record types and set the record type
automatically to the default if its not already set. 

Fixes #830