Fixed potential issues related to #14 in production branch