Improved some detection strategy. More tests added. Some of them failing (solution already thought).