Added a break to layout solving after 3s;
Added missing getIsLayoutActive checks.