AS7-6686 and AS7-6696 @ master

https://issues.jboss.org/browse/AS7-6686
https://issues.jboss.org/browse/AS7-6696