1) Added duration field for code problems.
2) Fixed a couple of bugs wiht N+1 detection.