Merge pull request #9 from pafei/develop

Reduce php error messages in error_log.
get rid of 'Invalid argument supplied for foreach()' errors