layout.cpp was missing <algorithm>, which (rightfully) doesn't work with VS2013