Fix task modification bug

Mainly caused by wrong datatypes in database