Fix for WFLY-1319 

The commit here fixes the issue reported in https://issues.jboss.org/browse/WFLY-1319