Fix #364. ensure a record is always passed to getType()

@ckung I'm still getting this error after your previous changes:

```
Uncaught TypeError: Cannot read property 'container' of undefined 
```

Ensuring the record always gets passed to getType fixes the issue and all tests still pass.