Fixes #19 and similar issues that could potentially happen on other constructs