Corrected the selectall_arrayref function call and added some error handling.
Fixed typo.
Formatting.
Handled locking in retrieve_list() calls when using SQLite.
Added tests for retrieve_list_nocache() calls that perform joins with lock=1.