Fix error statements, add DB code to 'stack'