fixes for WFLY-2723, WFLY-2791 and WFLY-2558

https://issues.jboss.org/browse/WFLY-2723
https://issues.jboss.org/browse/WFLY-2791
https://issues.jboss.org/browse/WFLY-2558