Improved runtime element check