Fixed issue with branch/page detection