fixed a typo
added type checks for compound types