Fix bug with non-existing button and bug with wrong selection