Fixes bugs in ArrayType and _cleanse_value