Safer typecheck in fd_define_get

@jessepinho Do you think this is good to merge and release?