solve CASC-224 and CASC-225

https://issues.jasig.org/browse/CASC-224
https://issues.jasig.org/browse/CASC-225