Added error for invalid layouts.