TW: Changed annoying class type validation warning to debug. Fixed error when reference and exists query.