LPS-35716 & LPS-36690

http://issues.liferay.com/browse/LPS-35716
http://issues.liferay.com/browse/LPS-36690