Fixes for WFLY-2410,2411,1982

https://issues.jboss.org/browse/WFLY-2411
https://issues.jboss.org/browse/WFLY-2410
https://issues.jboss.org/browse/WFLY-1982