Fixed Python script,database schema, minor additions to app code