Fixed determining of correct component layer