Check is nasty if no licenses are available.
Changed way of shared memory access to avoid bank conflicts.
Continued to change way of shared mem access.
Fix wrong shared mem index computation.