Removing old layout reference when changing layout to avoid errors when handling the layoutchange event (fixes #118)
Merge pull request #119 from andrecardoso/fixing-error-when-switching-layouts

Removing old layout reference when changing layout