Fixes & changes to sample generation

- Changed the way the sample page was generated. (Should increase
loading speed significantly) As before it was randoming until it got a
good number. Now it will just generate a goid number on the first try.
- Fixed an issue when errours occured causing the notesdone function not
to trigger. (Hopefully for good now!) Which was caused by me forgetting
to reset the errorcount when recaching.