Fix type assignment. Close #27